import Vue from 'vue'
import store from '../store'
import { cookieGet } from './storage'

Vue.prototype.window = window
Vue.prototype.document = window.document

window.commonParameter = Vue.prototype.commonParameter = function() {
  return {
    'appChannelCode': store.state.platform.appChannelCode,
    'appCityCode': '',
    'appId': 'SYSTEM001',
    'appIpAddress': 'string',
    'appMacAddress': 'string',
    'channelCode': store.state.platform.channelCode,
    'cityCode': '',
    'encryptData': '',
    'encryptType': '', // 微信小程序 "AES"  ： APP "SM4"
    'extension': {
      'encrypt-secret-key': '',
      'encrypt-salt': ''
    },
    'flowNum': 0,
    'msgType': '',
    'nonceString': '',
    'requestId': '',
    'signStamp': '',
    'signType': '', // 微信小程序 "SHA256"  ： APP "HMAC_SM3"
    'specVersion': '1.0.0',
    'terminalId': 'string',
    'timestamp': new Date().valueOf() + Number(store.state.platform.timeDiff),
    'trCode': '',
    'trToken': cookieGet('App-token'),
    'trVersion': 'string',
    'uniqueId': store.state.encryptParam.h5EncryptKey,
    'userId': cookieGet('App-userId')
  }
}
